package com.zian.domain.po;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.zian.enums.DefaultFlagEnum;
import com.zian.enums.IsDeletedEnum;
import com.zian.validation.ValidGroup;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 收货地址表
 * </p>
 *
 * @author
 * @since 2024-09-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_user_address")
 @ApiModel("SysUserAddress对象" )
public class SysUserAddress implements Serializable {


    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
     @ApiModelProperty( "地址主键id")
    @NotNull(message = "地址主键id不能为空",groups = {ValidGroup.Crud.Update.class})
    private Long id;

     @ApiModelProperty( "用户主键id")
    private Long userId;

     @ApiModelProperty( "收货人姓名")
    @NotBlank(message = "收货人姓名不能为空")
    private String userName;

     @ApiModelProperty( "收货人手机号")
    @NotBlank(message = "收货人手机号不能为空")
    private String userPhone;

     @ApiModelProperty( "是否为默认 0-非默认 1-是默认")
    @NotNull(message = "是否为默认不能为空")
    private DefaultFlagEnum defaultFlag;

     @ApiModelProperty( "省")
    @NotBlank(message = "省不能为空")
    private String provinceName;

     @ApiModelProperty( "市")
    @NotBlank(message = "市不能为空")
    private String cityName;

     @ApiModelProperty( "区")
    @NotBlank(message = "区不能为空")
    private String regionName;

     @ApiModelProperty( "收件详细地址(街道/楼宇/单元)")
    @NotBlank(message = "收件详细地址(街道/楼宇/单元)不能为空")
    private String detailAddress;

     @ApiModelProperty( "删除标识字段(0-未删除 1-已删除)")
    @TableLogic // 逻辑删除
    private IsDeletedEnum isDeleted;

     @ApiModelProperty( "添加时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

     @ApiModelProperty( "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


}
